package cn.tj212.xiaoyin.common.web.shiro;

import cn.tj212.xiaoyin.common.web.shiro.freemarker.ShiroTags;
import freemarker.template.TemplateException;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.IOException;

/**
 * shiro与freemarker的整合
 */
public class ShiroFreemarkerConfigurer extends FreeMarkerConfigurer {
    @Override
    public void afterPropertiesSet() throws IOException, TemplateException {
        super.afterPropertiesSet();
        this.getConfiguration().setSharedVariable("shiro",new ShiroTags());
    }
}
